<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="text" name="" id="height">cm
    <button id="btn">确定是否合格</button>
    <input type="text" name="" id="status">
    <script>
        document.getElementById("btn").onclick = function() {
            var _height = Number(document.getElementById("height").value);
            if (_height > 0 && _height <= 300) {
                if (
                    (_height - 108) * 2 > _height - 10 && (_height - 108) * 2 < _height + 10
                ) {
                    document.getElementById("status").value = "合格";
                } else {
                    document.getElementById("status").value = "不合格"
                }

            } else {
                document.getElementById("status").value = "输入错误";
            }

        }
    </script>
</body>

</html>